package com.aaa.day1106.day110601;

import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;
import org.w3c.dom.ls.LSOutput;

import java.util.stream.Stream;

/**
 * @author ${崔灿}
 * @date 2022/11/06 13:24
 **/

public class Test02 {
    public static void main(String[] args) {
        String[] arr1 = { "a", "b", "c", "d" };
        String[] arr2 = { "d", "e", "f", "g" };

        Stream<String> stream1= Stream.of(arr1);
        Stream<String> stream2= Stream.of(arr2);
        //合并流
        //Stream.concat(stream1, stream2).forEach(System.out ::println);

        //去重
        //Stream.concat(stream1, stream2).distinct().forEach(System.out ::println);

        //获取前n个元素
        //Stream.concat(stream1, stream2).limit(5).forEach(System.out ::println);

        //跳过前n个元素
        Stream.concat(stream1,stream2).skip(2).forEach(System.out ::println);


    }
}
